home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
others
/
cpc2pc.zip
/
CPC2PC.DOC
< prev
next >
Wrap
Text File
|
1994-05-21
|
20KB
|
592 lines
##############################################################################
# #
# This is the DOC File for CPC-2-PC V0.9ß a CPC-Emulator for the PC #
# #
##############################################################################
IMPORTANT NOTE:
===============
CPC-2-PC was made by Francisco López Mármol.
This documents and the files listen in it may be distribute freely, without
charge if copyright notices are left intact and no modification of the files
is made.
All software and documentation is provided "as is" without warranty
of any kind.
This program is freeware but I would certainly accept
any sort of support, financial or ideal.
(3000 ptas would be welcome)
INTRODUCTION:
=============
Well this is a CPC-Emulator.
What is an emulator?
An emulator is a program that can execute programs of other computer. His
mission is to replicate the computer that the emulator emulate.
In this case CPC2PC is a CPC emulator for a PC. That is, you can execute
a game (for example) of the CPC with this emulator.
For what?
Good question, an emulator generally improves in velocity of calculus,
ergonomy (70Hz screens, a good keyboard, velocity of hard-disc...)
For me this emulator serve for execute some good CPC program without
remove my old CPC (also my CPC has broken his disc-drive, many keys works
with beats, the screen flickers a lot, is a green-phosphorus screen ,well,
if someone has his CPC like mine he has the problem solve ;-)
What is a CPC:
-------------
Basically an Amstrad-CPC is a 8bit machine with a Z80A CPU, 3" disc-drive,
his operating system is AMSDOS althoght CP/M also run.
And a powerful BASIC implemented. A PSG (programable Sound Generator) of 3
channels and a screen-system with several resolution(up to 640x200) and
colors(up to 16).
SYSTEM REQUIREMENTS
===================
You must have an AT 386+ with MS-DOS 3.0+ and no memory managers in your
config file(Like EMM386, QEMM...) because this program run in protected mode
(Without DPMI or VCPI:-). Can run with XMS.
You must have about 400Kb free memory for run this program.
INSTALATION
===========
Extract the files from the compress file. And type INSTALL.
This emulator is provided without roms so if you don't have the roms files
read the ROMs, How to get files & Utility parts for get the roms.
You CAN'T USE the emulator WITHOUT ROMS.
The configuration menu:
----------------------
DISC PATH: The Disk-files directory
TAPE PATH: The Tape-files directory
ROM PATH: The ROMS-files directory
ROM FILES:
Filenames(of ROM-file) and Offsets(where is the rom in the ROM-File)
for the ROMS-Files
PRINTER FILE: A file, that is created in the TAPE directory, where the printer
data will be write.
DISC DIRECT: YES - if a file command occurs the emulator execute the ROM code.
NO - if a file command occurs the emulator execute the ROM code
in |DISC mode and control the file-access in |TAPE mode.
TAPE DIRECT: YES - if a file command occurs the emulator control the file
access.
NO - if a file command occurs the emulator execute the ROM code
in |DISC mode and control the file-access in |TAPE mode.
SOUND with GRAVIS ULTRASOUND: YES/NO Only if you have a Gravis Ultrasound
soundcard you can hear the PSG emulation. }:-)
PORT: Port used in the soundcard 2=220h,3=230h...
DISC SPEEDUP: Makes the disc access more fast.
PIO PORT B: Value returned from PIO PORT B, for change the machine name(for
example)
INTERRUPT SPEED: The number of times in a second where a interrupt occurrs. (130h)
VRAM UPDATE SPEED: InterrupSpeed/X. X=6 for 50Hz
CNT FOR VSINC: The numbers of IN instruction for gives a 1 in VSINC bit.
All numbers is in hexadecimal. Use arrow keys for move in and ENTER for enter a value. Use
ESC if you don't want to save the config and F10 if you want to save it.
The Path and DISC SPEEDUP fields has effect only at start the program.
If you have a problem for entry in configuration menu you can delete the file CPC2PC.CFG
and run the program for start in configuration menu.
The ROMS: (How to get)
--------
The ROMS are not included in this package because legal problems I'm not
able to put the ROMS with my emulator because is copyright of AMSTRAD :-(
However, I put in a program for get the ROMS (GETROMS.BAS).
When you got the roms files with that program you must transmit the files
with my programs for transmit files(see the section "How to get files")
If you have the roms files yet from others emulators you can use them,
indicate it in the configuration menu.
-- For example: --
If I have the roms from CPCEMU(Marco Vieth emulator),and his config. is:
ROM_BLOCKS = 3 ;number of ROM-blocks to load
; romnum: file: offset in file:
255 Z80CPC.ROM 0x0000
0 Z80CPC.ROM 0x4000
7 Z80DISK.ROM 0x0000
I only must indicate it in the ROM-PATH where is the roms and the OFFSET is
the same + 80h. My config will be:
Filename Offset
0 Z80CPC.ROM 4080 BASIC ROM
7 Z80DISK.ROM 0080 Disc ROM
255 Z80CPC.ROM 0080 System ROM
If I get the roms with my programs(GETROMS.BAS and TFILE1.BAS) the config
must be:
- For CPCs WITH disc-drive:
Filename Offset
0 BASIC.ROM 0080 BASIC ROM
7 DISC.ROM 0080 Disc ROM
255 SYSTEM.ROM 0080 System ROM
- For CPCs WITHOUT disc-drive:
Filename Offset
0 BASIC.ROM 0080 BASIC ROM
7 0080 Disc ROM
255 SYSTEM.ROM 0080 System ROM
---- See the section How to get files & utility for more info. ----
HOW TO GET FILES?
=================
Well, you must use my program TFILE1.BAS or TDISK.BAS; with that programs
you can transfer from CPC to PC files or full disks. This work with a
parallel connection, See UTILITY.DOC(in the utility directory) for details
about how to make and use this programs and the parallel connection and for
"how to get roms".
My tape-files and disk-files are compatible with Marco Vieth format, so
you can use the files of CPCEMU with my emulator and vice versa.
Tape files in ASCII is not supported in the same format, and disk files
is supported only with SYSTEM or DATA format.
FILE-FORMAT & DISK-FORMAT:
==========================
The tape and disk file format are compatible with CPCEMU emulator by Marco
Vieth:
Tape files is a raw format with an AMSDOS header before the data.
From Marco Vieth emulator:
-------------------------- cut here -------------------------------------
A1.4 Structure of Disc - Images :
----------------------------------
Disc-image files consist of a 0x100-byte disc-info block and
for each track a 0x100-byte track-info block, followed by the
data for every sector in that track.
A1.4.1 The Disc - Information block :
--------------------------------------
Byte (hex) : Meaning:
00 - 21 MV - CPCEMU Disk-File\r\nDisk-Info\r\n
(as characteristic "MV - CPC")
22 - 2F unused (0)
30 number of tracks (40, 42, maybe 80)
31 number of heads (1 or 2)
32 - 33 size of one track (including 0x100-byte track-info)
With 9 sectors * 0x200 bytes + 0x100 byte track-
info = 0x1300.
34 - FF unused (0)
A1.4.2 The Track - Information block (for every track) :
---------------------------------------------------------
Byte (hex) : Meaning:
00 - 0C Track-Info\r\n
0D - 0F unused (0)
10 track - number (0 to num.of tracks -1)
11 head - number (0 or 1)
12 - 13 unused (0)
Format-track-parameters:
14 BPS (bytes per sector) (2 for 0x200 bytes)
15 SPT (sectors per track) (9, at the most 18)
16 GAP#3-format (gap for formatting; 0x4E)
17 Filling-byte (filling-byte for formatting; 0xE5)
Sector-info (for every sector at a time):
18+i track-number \
19+i head-number | sector-ID-information
1A+i Sector-number |
1B+i BPS /
1C+i state 1 error-code (0)
1D+i State 2 error-code (0)
1E+i , 1F+i unused (0)
Annotations:
The sector-data must follow the track-information-block
in the order of the sector-IDs. No track or sector may be
omitted. With double sided formats, the tracks are alternating,
e.g. track 0 head 0, track 0 head 1, track 1 ...
Use CPCTRANS to copy CPC-discs into this format.
A1.5 Structure of the AMSDOS - Header :
----------------------------------------
Byte (hex:) Meaning:
00 user-number (0 , possible values 0-15)
01 - 0F filename+extension (possibly filled with 0)
10 block-number (0)
11 last-block-flag (0)
12 file-type (0=basic, 1=protected basic, 2=binary,...)
13 - 14 length of block (0)
15 - 16 load-address (0-FFFF)
17 first-block-flag (0)
18 - 19 logical length (0-FFFF)
1A - 1B entry-address (0-FFFF)
1C - 3F free for the user (0)
40 - 42 real length of file (1-FFFFFF)
43 - 44 checksum of bytes 00-42
45 - 7F unused (random values from sector-buffer)
Annotation:
A header stands at the beginning of every non-ASCII file. It
is identified by calculating the checksum.
Bytes 00-3F originate from the "cassette-area", where files
were divided up into blocks.
Necessary are the bytes 12, 15-16, 1A-1B, 40-42, 43-44 .
-------------------------- cut here -------------------------------------
THE KEYS:
=========
General Keys:
------------
F12 - For debug mode.
F11 - For disk-insert menu.
F10 - For configuration menu.
F8 - Exit from emulation.
F7 - Reset the CPC.
F1 - Toggle Joy on/off (with cursor keys & space)
....F9 - Toggle Joystick on/off
The keys in DEBUG MODE:
TAB - Moves into Dissasembly,Register or Dump Memory windows.
-- Dissasembly:
---------------
Arrow Keys - Move over the code.
F5 - View the output screen.
F4 - Execute until go to the line under the cursor.
F8 - Step, execute step by step if a CALL, RST is encounter it jump it.
F7 - Trace, execute step by step if a CALL, RST is encounter it go in it.
F9 - Exit from debug mode.
Ctrl-N - PC = Cursor pos
If F4 or F8 lost the control push F12 for break the execution.
-- Dump Memory & Register not available, some day ...
THE FILES:
==========
CPC2PC.EXE - The main program, the emulator of CPC.
CPC2PC.CFG - The config file.
CPC2PC.DOC - The DOCs about this emulator.
UTILITY.DOC - The DOCs about the utility programs.
TFILES1.BAS - CPC program for transfer files
FILE1GEN.BAS - CPC program for make a FILE1.BIN file need by TFILES1.BAS
TFILE.EXE - PC program for get files from CPC.
TDISK.BAS - CPC program for transfer disks of DATA/SYSTEM format only.
TDISK.EXE - PC program for get disks from CPC.
CHECKPAR.EXE - Check parallel connection programs
CHECKPAR.BAS
GETROMS.BAS - CPC program for get the roms files.
PD1.DSK - PD Programs Disk I
PD2.DSK - PD Programs Disk II
COMPATIBILITY
=============
What is support:
---------------
- Z80A: All instruction and the illegal instructions.
2 interrupt modes (1 and 2)
- 128Kb of RAM banking.
- 48Kb of ROMS-banking (System,Basic and Disc roms).
- Gate Array:
3 modes(2,4 & 16 colors)
- CRT: Hardware scroll, and several sizes.
- PIO port:
Keyboard, Joystick & VSinc bit.
- PRINTER
- FDC: Compatible only with DATA/SYSTEM format.
Support the basic command only, Read,Write,Read-Id,Seek,Recalibrate...
- PSG: Only basic sound and volume.
What is not support:
-------------------
- Envelopes, Noise in PSG emulation.
- Disk formats others than system or data format.
- overscan
- several screen-modes on the same screen (flickering)
- OS/2 & WINDOWS. I don't like DPMI }:-]
- CP/M Plus
IN THE FUTURE:
=============
- faster
- snapshoot
- PSG emulation complete
- More debug command
- Other Disk formats
HISTORY OF THE EMULATOR:
========================
Introduction:
------------
In 1992, I don't remember exactly when, I saw a Spectrum emulator by Pedro
Gimeno (Spain) and I thought in the possibility of doing a CPC emulator. But
I hadn't internet or BBS access and I didn't know how to get the CPC roms and
I thought how to get it with a serial connection but my economical status....
:-(
I thought copy the rom byte a byte, 48Kb!!! No,no I'm not crazy(not enough;-)
Well the project went out of my head.....
...In the summer of 1993 I saw in a electronical reviews an article about
parallel transfer of two PCs :-) (Idea!) But the reviews is in a local
library and the review went to another local library :-(. While a wait for
the review I investigated the parallel connection from CPC to PC(Very
interesting) and the dream come true :-) the roms were mine, the project was
open:
...In octuber 1993 I began to make a CPC emulator in 1 week, 3 days, 2 hours
& 1 minute(no sleep) I had a fine reset in emulator and I can see badly a
game. :-)
In Octuber I works hard. My CPC disc-drive crashed it. :-( I get one
CPC from my neighbor :-) The CPC disc-drive of my neighbor crash it.
:''''''''( A friend lend my another CPC with the disc-drive off :-(
Well, with a cocktail of 3 disc-drive I made a good disc-drive. I return
the CPC to my neighbor. Project close....
... From December 1993 I have opened the project and today I'm happy because
the the CPC of my neighbor don't crashed since. :-)
I really wanted to do an Amiga 500 emulator but for what, for 10 parallel
pentium with a Hiper-Acelelator Video Card. :-DDDDDDDDD
Notes:
-----
---- From summer 1993 to December 1993 I lost the info of the versions ----
[20-12-93]
- First version(documented).
- Decode with a table and a binary search.
- Optimization of jumps in decode sections.
- My emulator don't find the DISC roms cause a bug in rom-banking.
Now the bug corrected.
[1-1-94]
- Update the screen each x Hz. Word to Word. Using 386 BT instruction.
- Memory system changed, more fast. (Paging by sofware with a table
of relocation and 386 dir. modes)
[2-1-94]
- LDDR LDIR now improved
- dh now as F
- FLAG_N now in dh
[4-1-94]
- 320*200*4 CGA + Crt Offset
[5-1-94]
- 320*200*4 CGA + Crt Offset + Several Sizes ─┐
- 640*200*4 CGA + Crt Offset + Several Sizes ├ Not Automatic
- 160*200*4 MCGA + Crt Offset+ Several Sizes ─┘
[9-1-94]
- 320*200*4 CGA + Crt Offset + Several Sizes ─┐
- 640*200*4 CGA + Crt Offset + Several Sizes ├ Automatic
- 160*200*4 MCGA + Crt Offset+ Several Sizes ─┘
[14-1-94]
- Changes in list of debug mode. No control.
[16-1-94]
- Control of DEBUG : TRACE,STEP,VIEW SCREEN,RUN ++
[19-1-94]
- DEBUG Moves with Left, Right, PgUp y PgDown.
[11-2-94]
- One month was doing nothing!
- "The Bug Of The Flickering" in mode 2 killed.
[1-3-94]
- VRETRACE better simulation some games run well now ;-)
[6-3-94]
- Sound improved only with GUS }:-)
- New file format compatible with CPC EMU format by Marco Vieth
- Now tape file find for *.bas and *.bin
- Modified TFILE (file transmision utility) for new file format
(Marco Vieth format)
- Modified TDISK (disk transmision utility) for new disk format
(Marco Vieth format)
- Now emulate FDC (command READ-ID,READ,WRITE,SEEK ... not FORMAT
or SCAN x)
- Tape accept new format
- Bug fix in debug:instructions DD + COOP + oper. not list very well.
[8-3-94]
- Now All Graphics Update Made on mode 0E (BIOS) not modes 4,6,13h.
For What? Thinking in Paging?
[25-3-94]
- Now, Configuration file .CFG accept.
---- Porting to protected mode...... Bye Turbo Debug! ----
[30-3-94]
- Well... see if the Protected Mode Interface run well:
- Begin making changes in real code.
- some changes made ... buf! Isn't easy porting real mode to PM.
[1-4-94 00:30]
- Hey! seem that BASIC go well! Since 4 days that I
begin to make changes is hour for see something.
The last 4 days I only see bugs. What a bugs! I was really
desperate: I didn't see nothing not even the CPC Reset.
[2-4-94 00:40]
- A bug that is killing my patient all days was removed. The bug was
in the protected mode interface (v86 int) is hard when the prot.
mode. interface is who has the bug.
[2-4-94 21:30]
- Tape Added. Many problems because I access to DOS when
the IRQ0 handler was redirected to my subrutine.
[3-4-94 00:15]
- AMSDOS ROM banking (ROM n.7) added.
FDC system added. No problems.
[3-4-94 02:40]
- Disk-Insert menu added and run well.
[3-4-94 18:52]
- Debug-Mode menu added.ok.
[3-4-94 18:52]
- Configuration menu (added only screen)
[3-4.94 19:42]
- All graph modes (0 and 2 not found yet)
[5-7-94 4:22]
- |-] RAM-banking added +64Kb of CPC 6128
Check seems O.K. (Bed? Where are my bed? )
[13-4-94 00:22]
- Configuration menu terminate (I think :-?)
[8-5-94 16:50]
- New Screen Update. More Speed & smooth.
[9-5-94 0:12]
- Corrected some bugs.(screen update,screen size,divide
by 0 exception)
SOME INSIDE INFO ABOUT THE EMULATOR:
====================================
CPC-2-PC is 100% made in 386+ Protected Mode ASM, only the utilities was made
in C and ASM.
I use TASM 3.1 and BORLANDC 3.1.
Lines of code: About 23.500 lines
The code was made first in real mode and later was converted from real mode
to protected mode.
The protected mode header was made by me, and not support DPMI or VCPI cause
I need full speed. Really the emulator don't need PM but I use it for
emulate the ram and rom banking by hardware.
OTHERS CPC EMULATOR:
====================
While I began to make my emulator I didn't known that exists other CPC
emulator, but exists others 3 emulators:
- CPCEMU (c) 1993 by Marco Vieth(Germany). A very good emulator for the CPC
with many improvements like ROM adding,RAM up to 576Kb ...
- SIMCPC :
CPC - emulator for PC/XT/AT (c) 1989, 90 by GHE, Aachen
I don't know very much about it. I only know that has the CPC ROMs. :)
- CPE by Bernd S.(Germany). I know this emulator since a bit days from
release my emulator. Still is in development. Is very fast!
ACKNOWLEDGMENTS:
================
- Marco Vieth for the info about Ram-Banking, FDC, Screen-Update and
of course for making his CPCEMU emulator and for many mail about
CPC-Emulation.
- Jose Pio Martinez, my teacher, for listen the chats about the
development of the emulator ,for some suggestions, for the info about
the FDC and for lend me his access to internet e-mails.
- Cesar Muñoz & Daniel Muñoz for lend me a lot of several CPC tech-books,
Without that books the emulator wouldn't exists.
- Paco Pelluz for lend me the book "Programming the Z80" of Rodnay Zaks
the best book about the Z80. (you don't see me so! Well ... yes,yes I
lose my book so... NO EXCUSE :-(
- To my neighbour ,of course :-) and to my friend Ismael San Pedro for
the 3rd CPC of my life. :-)
- To the users of my emulator...
TRADEMARKS:
===========
CP/M, CP/M 2.2 and DRDOS are trademarks of Digital Research.
MS-DOS is a trademark of Microsoft.
IBM PC, PC-XT, PC-AT and OS/2 are trademarks of International
Business Machines,
CPC, AMSDOS by Amstrad,
BORLAND C, TASM (Turbo Assembler) by Borland,
AMIGA 500 by Comodore,
Pentium by Intel.
CONTACT WITH THE AUTOR:
=======================
Francisco Lopez Marmol (20)
Student at Murcia University (Spain)
If you want to contact with me for any suggestion or you find any bug
you can send me mail to:
--- By normal mail:
C/ De La Flota 3, 1-B
30008 MURCIA
(SPAIN)
--- or by Netmail to:
Fidonet: 2:345/805.3
Soundnet: 34:1000/100.3
SBCNet: 14:4500/201.4
--- or by E-mail: marmol@fcu.um.es
WANTED:
======
Some years ago I lost my favorite game: "Crafton & Xunx", please if you
have this game write me.
Thanks in advance. :)
And remember: The best emulator is the hardware. When you have it ;-)
Bye!